home *** CD-ROM | disk | FTP | other *** search
- #include<stdlib.h>
- #include<kiwi_inc.h>
- #include<kiwipro.h>
- #include<demopro.h>
-
- #define MAX_STAPEL 15
- static WINDOW win[MAX_STAPEL],w;
-
- int zeige_dyn_fenster()
- {
- int i;
- unsigned mx,my;
- VSCREEN vs[3];
-
- set_color_table(1);
- win[0]=load_window("DEMO1.WND");
- vs[0]=get_linked_screen(win[0]);
-
- set_color_table(2);
- win[1]=load_window("DEMO20.WND");
- vs[1]=get_linked_screen(win[1]);
-
- set_color_table(3);
- win[2]=load_window("DEMO21.WND");
- vs[2]=get_linked_screen(win[2]);
-
- for(i=3;i<6;i++)
- {
- win[i]=open_window("",5+5*i,4*i,22+5*i,4+4*i,DOPPELT);
- link_virtuell_screen(vs[i-3],win[i],i*5,i*5);
- }
-
- do
- {
- mouse(&mx,&my);
- }while(input()!=27);
-
- for(i=5;i>=0;i--)close_window(win[i]);
- return(0);
- }
-
-
-
-
-
-
- /*****************************************************************************
- *Name :zeige_stapel_window
- *Typ :int
- *Zweck:Zeigt die funktion Stapeln
- *
- *
- * Name Typ Zweck
- *Aufrufpara :
- *
- *Rueckgabep :
- *
- *Funktionswt: 0 Immer
- *
- *****************************************************************************/
- int zeige_stapeln_window()
- {
- int i,wide,height,color,count;
- int xa,ya,xe,ye,ptr,num,maxx,maxy;
- UINT mx,my;
- unsigned char c;
-
- w=load_window("demo14.wnd");
- wait_of_action();
-
- wide=get_screen_wide(); /* Hole Bildschirmgroesse */
- height=get_screen_height();
- color=ptr=0;
- maxx=(int)(32768l/wide);
- maxy=(int)(32768l/height);
- count=0;
- while(!input() && mouse(&mx,&my) !=2) /* Solange keine Taste gedrueckt */
- {
- num=rand();
- xa=num/maxx;
- num=rand();
- xe=num/maxx;
- if(xa>xe)swap_int(&xa,&xe);
- if(xe-xa<8)xe=xa+8;
-
- num=rand();
- ya=num/maxy;
- num=rand();
- ye=num/maxy;
- if(ya>ye)swap_int(&ya,&ye);
- if(ye-ya<5)ye=ya+5;
- /* erzeuge Fenstergroesse */
- if(count==0){ /* Setze Farbe, Form, Rand */
- c=EINFACH;
- FLIPC
- count++;}
- else if(count==1){
- FLIPC
- c=DOPPELT;
- count++;}
- else {
- if(++color>4)color=0;
- set_color_table(color);
- c=KEIN_RAND;
- count=0;}
-
- /* Ist Stapel noch nicht voll dann lege Fenster drauf */
- if(ptr<MAX_STAPEL)win[ptr++]=open_window("Stapeltest",xa,ya,xe,ye,c);
- else { /* Stapel ist Voll, loesche erste das unterste */
- close_window(win[0]);
- for(i=0;i<MAX_STAPEL-1;i++)win[i]=win[i+1];/* Jetzt oben daruf */
- win[MAX_STAPEL-1]=open_window("Stapeltest",xa,ya,xe,ye,c);
- }
-
- };
- for(i=0;i<ptr;i++)close_window(win[i]);
- close_window(w);
-
- return(0);
- }
-
-
- /*****************************************************************************
- *Name :zeige_fenster_farbe
- *Typ :int
- *Zweck:Zeigt die Funktion Einfaerben
- *
- *
- * Name Typ Zweck
- *Aufrufpara :
- *
- *Rueckgabep :
- *
- *Funktionswt: 0 Immer
- *
- *****************************************************************************/
- int zeige_fenster_farbe()
- {
- int color=0,count;
- UINT mx,my;
-
- w=load_window("demo14.wnd");
- wait_of_action();
-
- count=0;
- while(!input() && mouse(&mx,&my)!=2) /* Solange keine Taste gedrueckt */
- {
- if(count==0){ /* Waehle Farbe aus Tabellen */
- FLIPC
- count++;}
- else if(count==1){
- FLIPC
- count++;}
- else {
- if(++color>4)color=0;
- set_color_table(color);
- count=0;}
-
- set_window_attribut(w,ATTRIBUT); /* Setze Neue Farbe */
- kw_wait(20); /* Warte 20 Hunderstel */
- };
-
- close_window(w);
-
- return(0);
- }
-
-
-
-
-
- /*****************************************************************************
- *Name :zeige_schreiben_window
- *Typ :int
- *Zweck:Zeigt Fensterbeschreiben
- *
- *
- * Name Typ Zweck
- *Aufrufpara :
- *
- *Rueckgabep :
- *
- *Funktionswt: 0 Immer
- *
- *****************************************************************************/
- int zeige_schreiben_window()
- {
- int i,j,wide,height,color=0,count=0;
- int xa,ya,xe,ye,ptr;
- UINT mx,my;
- unsigned char c;
-
- w=load_window("demo14.wnd");
- wait_of_action();
-
- wide=get_screen_wide();
- height=get_screen_height();
- color=ptr=0;
- ptr=(wide/6 < height/4) ? wide/6 : height/4;
- if(ptr>MAX_STAPEL)ptr=MAX_STAPEL-1;
-
- while(!input() && mouse(&mx,&my)!=2)
- {
- for(i=0;i<ptr;i++) /* Erzeuge nacheinander Fenster */
- {
- if(count==0){
- c=EINFACH;
- FLIPC
- count++;}
- else if(count==1){
- FLIPC
- c=DOPPELT;
- count++;}
- else {
- if(++color>4)color=0;
- set_color_table(color);
- c=KEIN_RAND;
- count=0;}
-
- xa=1+i*3;
- xe=wide-i*3;
- ya=1+i*2;
- ye=height-i*2;
-
- win[i]=open_window("Schreibtest",xa,ya,xe,ye,c);
- }
- for(j=1;j<height+2;j++)/* Schreibe in jedes Fenster an jede Stelle */
- for(i=0;i<ptr;i++)
- display_string("Das ist ein Test bei dem in ein verdecktes Fenster in der Fensterfarbe geschrieben wird",win[i],AL,j);
- kw_wait(150);
-
- if(count)for(i=ptr-1;i>=0;i--)close_window(win[i]);
- else for(i=0;i<ptr;i++)close_window(win[i]);
-
- };
-
- close_window(w);
- return(0);
- }